import qs from 'querystring'

export default async (apiName, result, query, param, method) => {
    if (apiName == '/archive-collection/description/archive' && method == 'get') {
        try {
            query = qs.parse(query)
        } catch (error) {

        }
        for (let i = 0; i < result.data.data.length; i++) {
            result.data.data[i].categoryId = parseInt(query.categoryId)
        }
        console.log(result)
    }
    if (apiName === '/login') {
        result.data.role = result.data.role.replace(/,/g, ', ')
    }
    return result
}